﻿#parse("partials/header.html") #parse("partials/sidebar.html")
<script type="text/javascript">
    $(document).ready(function () {
        //Initialization
        SetEnableDisableSubmit();
        function SetEnableDisableSubmit() {
            if ($("#HiddenDoctorIdValue").val() != "") {
                $("#buttonSubmitReg").attr("disabled", false);
            }
        }
        //Datatable registration
        var oTableRegistration = $('#datalistregistration').dataTable({
            "bSort": false,
            "sPaginationType": "full_numbers",
            "bProcessing": true,
            "bServerSide": true,
            "bFilter": false,
            "sAjaxSource": "registrationnextsteppost",
            "aoColumns": [
                            { "mDataProp": "RegistrationNum" },
                            { "mDataProp": "RegistrationTime" },
                            { "mDataProp": "FullName" },
                            { "mDataProp": "Specialist" },
                            { "mDataProp": "ReferingDoctor" }
                        ],
            "fnServerData": function (sSource, aoData, fnCallback) {
                var isInternalDoctor = $("#RadioInternal").is(":checked") ? "1" : "0";
                aoData.push({ "name": "HiddenIsSubmit", "value": $('#HiddenIsSubmit').val() });
                aoData.push({ "name": "TextboxDoctorName", "value": $('#TextboxDoctorName').val() });
                aoData.push({ "name": "HiddenDoctorIdValue", "value": $('#HiddenDoctorIdValue').val() });
                aoData.push({ "name": "HiddenUserId", "value": $('#HiddenUserId').val() });
                aoData.push({ "name": "TextboxReferedDoctor", "value": $('#TextboxReferedDoctor').val() });
                aoData.push({ "name": "HiddenReferedDoctorIdValue", "value": $('#HiddenReferedDoctorIdValue').val() });
                aoData.push({ "name": "TextboxReferedExtDoctor", "value": $('#TextboxReferedExtDoctor').val() });
                aoData.push({ "name": "HiddenReferedExtDoctorIdValue", "value": $('#HiddenReferedExtDoctorIdValue').val() });
                aoData.push({ "name": "isInternalDoctor", "value": isInternalDoctor });
                jQuery.ajax({
                    "dataType": 'json',
                    "type": "GET",
                    "url": "registrationnextsteppost",
                    "data": aoData,
                    "success": function (data) {
                        if (data['sEcho'] == "1") {
                            $("#notif").html("");
                        } else if (data.ExceptionMessage != null) {
                            alert(data.ExceptionMessage);
                        } else {
                            window.scrollTo(0, 0);
                            $("#notif").html("<div class='mws-form-message success'><h2>Congratulations!</h2><p>Registration Completed! </p></div>");
                        }

                        fnCallback(data);
                    }

                });
            }
        });

        $('#buttonSubmitReg').click(function () {
            $('#HiddenIsSubmit').val("1");
            oTableRegistration.fnDraw();
            $('#TextboxDoctorName').val("");
            $('#HiddenDoctorIdValue').val("");
            $('#HiddenUserId').val("");
            $("#LabelDoctorName").html("");
            $('#TextboxReferedDoctor').val("");
            $('#HiddenReferedDoctorIdValue').val("");
            $("#LabelReferedIntDoctorName").html("");
            $('#TextboxReferedExtDoctor').val("");
            $('#HiddenReferedExtDoctorIdValue').val("");
            $("#LabelReferedExtDoctorName").html("");
            $("#buttonSubmitReg").attr("disabled", true);
            $('#HiddenIsSubmit').val("0");
        });
        //End Datatable Registration
        $("#mws-form-dialog-ExtDoctor").dialog({
            width: 1075,
            height: 580,
            modal: true,
            autoOpen: false
        });
    });
//End Document.ready
    
    //Open Popup Doctor Handler
    function OpenPopUpDoctorHandler() {
        $("#HiddenIsDoctorHandler").val("1");
        $("#mws-form-dialog").dialog("open");
        $("#modalIframeForm").attr("src", rooturl + "home/popup/popupsearchdoctor");
        return false;
    }
    function setDoctorTextBox(doctorId, doctorName, UserId) {
        $("#TextboxDoctorName").val(doctorName);
        $("#LabelDoctorName").html(doctorName);
        $("#HiddenDoctorIdValue").val(doctorId);
        $("#HiddenUserId").val(UserId);
        $('#modalIframeForm').attr('src', '');
        $("#mws-form-dialog").dialog("close");
        $("#buttonSubmitReg").attr("disabled", false);
        $("#notif").html("");
    }
    function OpenPopUpReferedDoctor() {
        $("#HiddenIsDoctorHandler").val("0");
        $("#mws-form-dialog").dialog("open");
        $("#modalIframeForm").attr("src", rooturl + "home/popup/popupsearchalldoctor");
        return false;
    }
    function setReferedDoctorTextBox(doctorId, doctorName, UserId) {
        $("#TextboxReferedDoctor").val(doctorName);
        $("#LabelReferedIntDoctorName").html(doctorName);
        $("#HiddenReferedDoctorIdValue").val(doctorId);

        $("#TextboxReferedExtDoctor").val("");
        $("#LabelReferedExtDoctorName").html("");
        $("#HiddenReferedExtDoctorIdValue").val("");
        $('#modalIframeForm').attr('src', '');
        $("#mws-form-dialog").dialog("close");
    }

    function OpenPopUpReferedExtDoctor() {
        $("#HiddenIsDoctorHandler").val("0");
        $("#mws-form-dialog-ExtDoctor").dialog("open");
        $("#modalIframeFormExtDoctor").attr("src", rooturl + "home/popup/popupsearchextdoctor");
        return false;
    }
   
    function IsDoctorHandler() {
        return $("#HiddenIsDoctorHandler").val();
    }

    function SetExtDoctor(doctorId, doctorName, TitleBeforeName, TitleAfterName) {
        $("#TextboxReferedExtDoctor").val(doctorName);
        $("#LabelReferedExtDoctorName").html(TitleBeforeName + " " + doctorName + ", " + TitleAfterName);
        $("#HiddenReferedExtDoctorIdValue").val(doctorId);

        $("#TextboxReferedDoctor").val("");
        $("#LabelReferedIntDoctorName").html("");
        $("#HiddenReferedDoctorIdValue").val("");
        $('#modalIframeFormExtDoctor').attr('src', '');
        $("#mws-form-dialog-ExtDoctor").dialog("close");
    }

    function CloseDialog() {
        $('#modalIframeForm').attr('src', '');
        $("#mws-form-dialog").dialog("close");
    }

    function CloseExtDoctorDialog() {
        $('#modalIframeFormExtDoctor').attr('src', '');
        $("#mws-form-dialog-ExtDoctor").dialog("close");
    }
</script>
<style>
    div#datalistregistration_filter
    {
        display: none;
    }
    div#datalistregistration_length
    {
        display: none;
    }
    .mws-table thead
    {
        margin-top: -10px;
    }
</style>
<!-- Main Container Start -->
<div id="mws-container" class="clearfix">
<div id="mws-form-dialog-ExtDoctor">
        <iframe id="modalIframeFormExtDoctor" width="100%" height="100%" marginwidth="0" marginheight="0"
            frameborder="0" scrolling="auto" title="Dialog Title">Your browser does not support</iframe>
</div>
    <!-- Inner Container Start -->
    <div class="container">
        <!-- Panels Start -->
        <div class="mws-panel grid_8 mws-collapsible">
            <div class="title-caption">
                <h5>$headerinformation  - $Lob - Patient Registration</h5>
            </div>
            <div class="mws-panel-header">
                <span class="mws-i-24 i-calendar-today">Patient Registration Form</span>
            </div>
            <div class="mws-panel-body">
                <div class="mws-panel-toolbar top clearfix">
                    <ul>
                        <li><a class="mws-ic-16 ic-application-view-list" href="/frontoffice/lobselection/?redirectUri=patientdata/default" title="Search">Select LOB</a></li>
                        <li><a class="mws-ic-16 ic-application-view-list" href="/patientdata/default" title="Accept">Search
                            Patient</a></li>
                        <li><a class="mws-ic-16 ic-application-view-list" href="/frontoffice/registration/searchdoctor" title="Accept">Doctor List
                            </a></li>
                        <li><a class="mws-ic-16 ic-application-view-list" href="/frontoffice/registration/searchappointment" title="Accept">Appointment List
                        </a></li>
                       
                        <li><a class="mws-ic-16 ic-add" href="/patientdata/default/patientdetail" title="Accept">
                            New Patient Data Registration</a></li>
                        <!--<li><a class="mws-ic-16 ic-accept" href="/frontoffice/registration/registrationlist"
                            title="Accept">Registration List</a></li>-->
                    </ul>
                </div>
                <div id="notif">
                    $Notification
                </div>
                <div class="mws-form" action="#">
                    <div class="mws-form-inline">
                        <div class="mws-form-row">
                            <label>
                                Patient Name</label>
                            <div class="mws-form-item large">
                                <div class="mws-form-cols clearfix">
                                    <div class="mws-form-col-3-8 alpha">
                                        <div class="mws-form-item">
                                            : $oPatient.FirstName $oPatient.MiddleName $oPatient.LastName
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                         <div class="mws-form-row">
                            <label>
                                Medical Record No</label>
                            <div class="mws-form-item large">
                                <div class="mws-form-cols clearfix">
                                    <div class="mws-form-col-3-8 alpha">
                                        <div class="mws-form-item">
                                            : $oPatient.MedicalRecordNumber
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="mws-form-row">
                            <label>
                                Gender</label>
                            <div class="mws-form-item large">
                                <div class="mws-form-cols clearfix">
                                    <div class="mws-form-col-3-8 alpha">
                                        <div class="mws-form-item">
                                            : $Gender
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="mws-form-row">
                            <label>
                                Age</label>
                            <div class="mws-form-item large">
                                <div class="mws-form-cols clearfix">
                                    <div class="mws-form-col-3-8 alpha">
                                        <div class="mws-form-item">
                                            : $Age
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="mws-form-row">
                            <label>
                                Birth Place</label>
                            <div class="mws-form-item large">
                                <div class="mws-form-cols clearfix">
                                    <div class="mws-form-col-3-8 alpha">
                                        <div class="mws-form-item">
                                            : $oPatient.Birthplace
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <hr />
                    <div class="mws-form-inline">
                        <div class="mws-form-row">
                            <label>
                                <h6>Doctor <span style="color: #FF0000; font-size: large;">*</span>  </h6>
                            </label>
                            <div class="mws-form-item small">
                                <input type="button" id="ButtonDoctorSearch" class="mws-button green medium" value="Search Doctor " onclick="OpenPopUpDoctorHandler()" /> 
                            </div>
                        </div>
                        <div class="mws-form-row">
                            <label>
                                Doctor Name</label>
                            <div class="mws-form-item large">
                                <div class="mws-form-cols clearfix">
                                    <div class="mws-form-col-3-8 alpha">
                                        <div class="mws-form-item">
                                            :&nbsp;<span id="LabelDoctorName">$doctorName</span>
                                        </div>
                                    </div>
                                    <div class="mws-form-col-1-8">
                                        <div class="mws-form-item">
                                            <input id="TextboxDoctorName" name="TextboxDoctorName" readonly="true" type="hidden"
                                                class="mws-textinput" />
                                            <input id="HiddenDoctorIdValue" name="HiddenDoctorIdValue" type="hidden" value="$doctorId" />
                                            <input id="HiddenUserId" name="HiddenUserId" type="hidden" value="$UserId" />
                                            <input id="HiddenIsDoctorHandler" name="HiddenDoctorHandler" type="hidden" />
                                            
                                        </div>
                                    </div>
                                    <div class="mws-form-col-4-8 omega">
                                        <div class="mws-form-item">
                                            &nbsp;
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <hr />

                    <div class="mws-form-inline">
                        <div class="mws-form-row">
                                <label>
                                    <h6>Refering Doctor</h6>
                                </label>
                            <div class="mws-form-item large">
                                <div class="mws-form-cols clearfix">
                                    <div class="mws-form-col-8-8 omega">
                                        <div class="mws-form-item">
                                            <input type="button" id="ButtonReferedDoctorSearch" name="ButtonReferedDoctorSearch"
                                                class="mws-button green small" value="Internal Doctor " onclick="OpenPopUpReferedDoctor()" />
                                            <input type="button" id="ButtonExternalDoctor" class="mws-button green small" value="External Doctor"
                                                onclick="OpenPopUpReferedExtDoctor()" />
                                        </div>
                                    </div>
                                </div>
                              </div>   
                         </div>
                        <div class="mws-form-row">
                            <label>
                                Internal Doctor</label>
                            <div class="mws-form-item large">
                                <div class="mws-form-cols clearfix">
                                    <div class="mws-form-col-3-8 alpha">
                                        <div class="mws-form-item">
                                            :&nbsp;<span id="LabelReferedIntDoctorName"></span>
                                        </div>
                                    </div>
                                    <div class="mws-form-col-1-8">
                                        <div class="mws-form-item">
                                            <input id="TextboxReferedDoctor" readonly="true" name="TextboxReferedDoctor" type="hidden"
                                                class="mws-textinput" />
                                            <input id="HiddenReferedDoctorIdValue" name="HiddenReferedDoctorIdValue" type="hidden"
                                               />
                                        </div>
                                    </div>
                                    <div class="mws-form-col-4-8 omega">
                                        <div class="mws-form-item">
                                            &nbsp;
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="mws-form-row">
                            <label>
                                External Doctor</label>
                            <div class="mws-form-item large">
                                <div class="mws-form-cols clearfix">
                                    <div class="mws-form-col-3-8 alpha">
                                        <div class="mws-form-item">
                                           :&nbsp;<span id="LabelReferedExtDoctorName"></span>
                                        </div>
                                    </div>
                                    <div class="mws-form-col-1-8">
                                        <div class="mws-form-item">
                                           <input id="TextboxReferedExtDoctor" readonly="true" name="TextboxReferedExtDoctor" type="hidden"
                                                class="mws-textinput" />
                                            <input id="HiddenReferedExtDoctorIdValue" name="HiddenReferedExtDoctorIdValue" type="hidden"
                                                />
                                        </div>
                                    </div>
                                    <div class="mws-form-col-4-8 omega">
                                        <div class="mws-form-item">
                                            &nbsp;
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>

                    
                    <div class="mws-form-inline">
                        <div class="mws-form-row">
                            <br />
                            <span style="color: #FF0000; font-size: large;">*</span><span style="color: #FF0000;"> : Mandatory</span>
                        </div>
                    </div>
                    <div class="mws-button-row">
                        <!--<input id="HiddenIsFirstLoad" name="HiddenIsFirstLoad" type="hidden" value="1"/>-->
                        <input id="HiddenIsSubmit" name="HiddenIsSubmit" type="hidden" value="0"/>
                        <input name="buttonSubmitReg" id="buttonSubmitReg" disabled=true type="submit" value="Submit" class="mws-button red" />
                        <input type="Submit" value="Print" class="mws-button gray" />
                    </div>
                </div>
                
                <table cellpadding="0" cellspacing="0" border="0" class="mws-table" id="datalistregistration"
                    width="100%">
                    <thead>
                        <tr>
                           <!-- <th style="width: 10px; text-align: center">
                                Actions
                            </th>-->
                            <th style="width:150px;text-align: center">
                                Registration No
                            </th>
                            <th style="width:150px;text-align: center">
                                Registration Time
                            </th>
                            <th style="text-align: center">
                                Doctor 
                            </th>
                            <th style="text-align: center">
                               Specialist
                            </th>
                             <th style="text-align: center">
                                Refering Doctor 
                            </th>
                           
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td colspan="7" class="dataTables_empty">
                            </td>
                        </tr>
                    </tbody>
                </table>
                
            </div>
        </div>
        <!-- Panels End -->
    </div>
    <div class="ajaxLoader" style="display: none;">
    </div>
    <!-- Inner Container End -->
    <!--End Search Area Dialog Content-->
#parse("partials/footer.html")